<me:UIWBBST x:Class="WPFExcelReport.TWB10"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT" 
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM" 
                    xmlns:BW="clr-namespace:WPFExcelReport;assembly=TWBBEW" 
                    xmlns:WB="clr-namespace:WPFExcelReport;assembly=TWBDAT" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                   x:Name="TV"
                    Background="White"  
                    Loaded="Window_Loaded"
     >
    <me:UIWBBST.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/> 
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>  
    </me:UIWBBST.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions> 
       <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
                Margin="10,0,0,0" VerticalAlignment="Top">
                <WrapPanel  >
                    <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" FontSize="18" Text="{Binding Source={Localization:Translate Word=卷号:}}"></TextBlock>
                            <ex:TXT72 MaxLength="12" Grid.Column="1" FontSize="18"  Foreground="Red"   
                                      Text="{Binding STKNR,ElementName=TV}" Width="160" />
                        </Grid>
                    <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button   Click="QueryCommand" Height="40" Margin="5,0,0,0" Width="40" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                            </Button.Background>
                        </Button>
                    </Grid>

                    <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" FontSize="18" Text="{Binding Source={Localization:Translate Word=剪出长度:}}"></TextBlock>
                        <ex:NumericBox Text="{Binding CMTR,ElementName=TV,Converter={StaticResource d1000}}"
                                       Grid.Column="1" FontSize="18"   Width="80" />
                    </Grid>
                    <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button   Click="NewCommand" Height="40" Margin="5,0,0,0" Width="40" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Cut.png" />
                            </Button.Background>
                        </Button>
                    </Grid>
                </WrapPanel> 
            </StackPanel>  
      
        <DataGrid  Grid.Row="1"  Grid.Column="0"
                   VerticalAlignment="Top"  
                   FontSize="16"
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible"  Margin="0,0,0,0"
                    >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=WBBSTKNR}" Header="{Binding Source={Localization:Translate Word=布卷}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WBBISTKLG,Converter={StaticResource d1000}}" Header="{Binding Source={Localization:Translate Word=长度}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WBBDPART,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=批次}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WBBBEM,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=备注}}"  Width="Auto" />
             </DataGrid.Columns>
        </DataGrid  >
        <WB:TWB04 Grid.Row="0" Grid.Column="1" 
                  Name="cWB04"
                  ORDERNUM="{Binding RWAUF, ElementName=TV}"/>
        <me:TWB25 Grid.Row="1" Grid.Column="1"
                  RWAUF="{Binding KEY,ElementName=cWB04}"
                  STKNR="{Binding STKNR,ElementName=TV}"
            />
    </Grid>
</me:UIWBBST>
